﻿using System;

namespace ElevatorAPI
{
    public class Person : IPerson
    {
        #region Properties

        public Enumerations.PersonStatus Status { get; set; }
        public Floor DestinationFloor { get; set; }
        public string Name { get; set; }

        private DateTime? WaitingStart ;
        private DateTime? WaitingEnd ;
        private DateTime? RidingStart ;
        private DateTime? RidingEnd ;

        public TimeSpan? TotalWaitingTime
        {
            get
            {
                return WaitingEnd - WaitingStart;
            }
        }

        public TimeSpan? TotalRidingTime
        {
            get
            {
                return RidingEnd - RidingStart;
            }
        }

        public void StartWaitingTimer()
        {
            WaitingStart = DateTime.Now;
        }

        public void EndWaitingTimer()
        {
            WaitingEnd = DateTime.Now;
        }

        public void StartRidingTimer()
        {
            RidingStart = DateTime.Now;
        }

        public void EndRidingTimer()
        {
            RidingEnd = DateTime.Now;
        }

        #endregion

        public uint FloorNumber { get; set; }
    }
}
